import $http from "@/utils/http/index";
import type {
  CommentReq,
  GetCommentByIdReq,
  DeleteCommentByIdReq,
  IRes
} from "../type/comment";

// 评论
export function comment(data: CommentReq) {
  return $http.post<IRes>({
    url: "/api/comment/comment",
    data,
  });
}

// 根据启事id获取所有评论
export function getCommentById(data: GetCommentByIdReq) {
  return $http.get<IRes>({
    url: "/api/comment/getCommentById",
    params: data
  });
}

// 根据评论id删除评论
export function deleteCommentById(data: DeleteCommentByIdReq) {
  return $http.delete<IRes>({
    url: "/api/comment/deleteCommentById",
    params: data,
  });
}
